<?php
require_once '../sub/init.php';
define('ZEAI2',dirname(__FILE__).DIRECTORY_SEPARATOR);
require_once 'chkUadm.php';
if (!ifint($uid))alert_adm("用户UID不正确","back");
//
if($session_kind == 'crm'){
	if(!in_array('crm_user_mod',$QXARR) && !in_array('crm_user_mod_my',$QXARR) )exit(noauth());
}else{
	if(!in_array('u_mod',$QXARR))exit(noauth('暂无【资料修改】权限'));
}
if($submitok == 'ajax_openid_bind'){
	$row = $db->ROW(__TBL_USER__,"nickname,openid"," openid<>'' AND id=".$uid,"name");
	if ($row){
		json_exit(array('flag'=>1,'msg'=>'绑定成功'));
	}else{
		json_exit(array('flag'=>0,'msg'=>'继续'));
	}
}elseif($submitok == 'ajax_openid_bind_cancel'){
	$db->query("UPDATE ".__TBL_USER__." SET openid='' WHERE id=".$uid);
	AddLog('取消【uid:'.$uid.'】微信绑定');
	json_exit(array('flag'=>1,'msg'=>'操作成功'));
}
require_once ZEAI.'cache/udata.php';$sex_ARR = json_decode($_UDATA['sex'],true);$extifshow = json_decode($_UDATA['extifshow'],true);
require_once ZEAI.'cache/config_up.php';
require_once ZEAI.'cache/config_vip.php';
require_once ZEAI.'sub/zeai_up_func.php';
header("Cache-control: private");

$rz_dataARR = explode(',',$_ZEAI['rz_data']);
$mate_diy = explode(',',$_ZEAI['mate_diy']);
$row_shalou=shalou_data($uid);
if (!$row_shalou){
	shalou_init($uid);
	set_data_ed_bfb($uid);
	alert_adm("【沙漏数据】已同步成功！",SELF."?submitok=mod&uid=$uid&t=$t&iframenav=$iframenav&ifmini=$ifmini");
}
if($submitok == 'ajax_set'){
	if(empty($objname))exit(JSON_ERROR);
	if($v==1){
		$v_str='设置成功';
	}else{
		$v=0;
		$v_str='设置成功';
	}
	switch ($objname) {
		case 'mob_ifshow':$sql="mob_ifshow=".$v;break;
		case 'qq_ifshow':$sql="qq_ifshow=".$v;break;
		case 'weixin_ifshow':$sql="weixin_ifshow=".$v;break;
		case 'weixin_pic_ifshow':$sql="weixin_pic_ifshow=".$v;break;
		case 'email_ifshow':$sql="email_ifshow=".$v;break;
	}
	$db->query("UPDATE ".__TBL_USER__." SET ".$sql." WHERE id=".$uid);
	json_exit(array('flag'=>1,'msg'=>$v_str));
}
/******************************* 修改 ******************************/
if ($submitok == 'rzpicDel'){
	if (!@in_array('crm',$QXARR) && $session_kind != 'adm')alert_adm("只有管理员才可以删除哦","-1");
	if(empty($picid))alert_adm("forbidden","-1");
	$picid = explode('_',$picid);
	$V=$picid[0];$i=$picid[1];
	$row = $db->ROW(__TBL_RZ__,"path_b,path_b2","uid=".$uid." AND rzid='$V'","name");
	if ($row){
		$path_b = $row['path_b'];$path_b2 = $row['path_b2'];
		if($i==1){
			@up_send_admindel($path_b);
			$db->query("UPDATE ".__TBL_RZ__." SET path_b='' WHERE uid=".$uid." AND rzid='$V'");
		}elseif($i==2){
			@up_send_admindel($path_b2);
			$db->query("UPDATE ".__TBL_RZ__." SET path_b2='' WHERE uid=".$uid." AND rzid='$V'");
		}
		$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
		AddLog('删除【'.$nickname.'（uid:'.$uid.'）】认证图片->'.rz_data_info($V,'title'));
	}
	json_exit(array('flag'=>1,'msg'=>'操作成功'));
}elseif($submitok == 'modupdate'){
	switch ($t) {
		case 1:
			$ifadm      = intval($ifadm);
			$kind       = intval($kind);
			$flag       = intval($flag);
			$uname      = dataIO($uname,'in',40);
			$openid     = dataIO($openid,'in',32);
			$union      = dataIO($union,'in',32);
			$tguid      = intval($tguid);
			$photo_ifshow = intval($photo_ifshow);
			//$xqk_ifshow = intval($xqk_ifshow);
			$agentid = intval($agentid);
			$admid   = intval($admid);
			$hnid    = intval($hnid);
			$hnid2   = intval($hnid2);
			$subscribe = intval($subscribe);
			$pwd     = trimhtml(dataIO($pwd,'in',20));
			$hh_num    = intval($hh_num);
			$rz_num    = intval($rz_num);
			$crm_qxnum = intval($crm_qxnum);
			$crm_yjnum = intval($crm_yjnum);
			$crm_ukind = intval($crm_ukind);
			$crm_fromclue = intval($crm_fromclue);
			$setsql  = "rz_num='$rz_num',hh_num='$hh_num',crm_qxnum='$crm_qxnum',crm_yjnum='$crm_yjnum',subscribe='$subscribe',photo_ifshow='$photo_ifshow',flag='$flag',ifadm='$ifadm',kind='$kind',tguid='$tguid',crm_ukind='$crm_ukind',crm_fromclue='$crm_fromclue'";//,xqk_ifshow='$xqk_ifshow'
			//
			if($agentid>0){
				$row3 = $db->ROW(__TBL_CRM_AGENT__,"title","id=".$agentid,"num");
				if ($row3)$setsql .= ",agentid=$agentid,agenttitle='".$row3[0]."'";
			}else{$setsql .= ",agentid=0,agenttitle=''";}
			if($admid>0){
				$row3 = $db->ROW(__TBL_CRM_HN__,"truename","id=".$admid,"num");
				if ($row3)$setsql .= ",admid=$admid,admname='".$row3[0]."'";
			}else{$setsql .= ",admid=0,admname=''";}
			if($hnid>0){
				$row3 = $db->ROW(__TBL_CRM_HN__,"truename","id=".$hnid,"num");
				if ($row3)$setsql .= ",hnid=$hnid,hnname='".$row3[0]."'";
			}else{$setsql .= ",hnid=0,hnname=''";}
			if($hnid2>0){
				$row3 = $db->ROW(__TBL_CRM_HN__,"truename","id=".$hnid2,"num");
				if ($row3)$setsql .= ",hnid2=$hnid2,hnname2='".$row3[0]."'";
			}else{$setsql .= ",hnid2=0,hnname2=''";}
			//			
			if ($openid != $openid_old){
				$row = $db->NUM('supdes','nickname',"openid='$openid' AND openid<>''");
				if($row){$varmsg.="“openid”已被【".dataIO($row[0],'out')."】占用";$ifnext=false;}else{$setsql .= ",openid='$openid'";}
			}
			if ($unionid != $unionid_old){
				$row = $db->NUM('supdes','nickname',"unionid='$unionid' AND unionid<>''");
				if($row){$varmsg.="“unionid”已被【".dataIO($row[0],'out')."】占用";$ifnext=false;}else{$setsql .= ",unionid='$unionid'";}
			}
			if ($loginkey != $loginkey_old){
				$row = $db->NUM('supdes','nickname',"loginkey='$loginkey' AND loginkey<>''");
				if($row){$varmsg.="“loginkey”已被【".dataIO($row[0],'out')."】占用";$ifnext=false;}else{$setsql .= ",loginkey='$loginkey'";}
			}
			if ($uname != $username_old){
				$row = $db->NUM('supdes','nickname',"uname='$uname' AND uname<>''");
				if($row){$varmsg.="“用户名”已被【".dataIO($row[0],'out')."】占用";$ifnext=false;}else{$setsql .= ",uname='$uname'";}
			}
			if ($email != $email_old){
				$row = $db->NUM('supdes','nickname',"email='$email' AND email<>''");
				if($row){$varmsg.="“Email”已被【".dataIO($row[0],'out')."】占用";$ifnext=false;}else{$setsql .= ",email='$email'";}
			}
			if (!empty($pwd) && str_len($pwd) <= 20 && str_len($pwd) >= 6){
				$pwd = md5(trimm($pwd));
				$setsql  .= ",pwd='$pwd'";
			}
			$db->query("UPDATE ".__TBL_USER__." SET ".$setsql." WHERE id=".$uid);
			//
			$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname2= $row2[0];
			$tguid=0;
			AddLog('修改用户【'.$nickname2.'（uid:'.$uid.'）】基本信息');
			alert_adm("【基本信息】修改成功！",SELF."?submitok=mod&uid=$uid&t=$t&iframenav=$iframenav&ifmini=$ifmini");
		break;
		case 2:
			$sql = array();$setsql = "";
			$form_data=udata_arr('basic_form_adm');
			foreach ($form_data as $V) {
				$F = $V['fieldname'];
				$D = $$F;
				if($F=='photo_s')continue;
				if($row_shalou['sex']==2 && $F=='tag1')continue;
				if($row_shalou['sex']==1 && $F=='tag2')continue;
				switch ($V['subkind']) {
					case 1://text
						switch ($F) {
							case 'identitynum':
								$D=trimhtml(dataIO($D,'in',18));
								$D=(ifsfz($D))?$D:'';
							break;
							case 'truename':$D=trimhtml(dataIO($D,'in',8));break;
							case 'nickname':$D=trimhtml(dataIO($D,'in',50));break;
							case 'aboutus':$D=trimhtml(dataIO($D,'in',2000));break;
							default:$D=trimhtml(dataIO($D,'in',200));break;
						}
						$sql[] = "$F='".$D."'";
					break;
					case 2://select
						$sql[] = "$F=".intval($D)."";
					break;
					case 3://checkbox
						$D = (is_array($D))?implode(',',$D):'';
						if($F=='tag1' || $F=='tag2'){
							$row_shalou['tag']=$D;
							$sql[] = "tag = '".$D."'";
						}
					break;
					default:
						switch ($F) {
							case 'areaid':
								$row_shalou['areatitle']=$areatitle;
								$sql[] = "areatitle = '".$areatitle."'";
								$D = getareaSQL($D);
							break;
							case 'area2id':
								$row_shalou['area2title']=$area2title;
								$sql[] = "area2title = '".$area2title."'";
								$D = getareaSQL($D);
							break;
							case 'birthday':
								if(!ifdate($D))alert_adm("请输入正确的【生日】格式为：<font class=\'Cf00\'>1995-09-09</font>","-1");
							break;
						}
						$sql[] = "$F = '".$D."'";
					break;
				}
				if($F!='tag1' && $F!='tag2')$row_shalou[$F]=$D;
			}
			//沙漏头像是否覆盖
			if($photo_sflag1==1)$sql[] = "photo_f=1,photo_s = '".$row_shalou['photo_s']."'";
			//扩展
			foreach ($extifshow as $V) {
				$F = $V['f'];
				$D = $$F;
				if($row_shalou['sex']==2 && $F=='tag1')continue;
				if($row_shalou['sex']==1 && $F=='tag2')continue;
				switch ($V['s']) {
					case 1://text
						$sql[] = "$F='".dataIO(trimhtml($D),'in',200)."'";
					break;
					case 2://select
						$sql[] = "$F=".intval($D)."";
					break;
					case 3://checkbox
						$D = (is_array($D))?implode(',',$D):'';
						if($F=='tag1' || $F=='tag2'){
							$row_shalou['tag']=$D;
							$sql[] = "tag = '".$D."'";
						}else{
							$sql[] = " $F = '".$D."'";
						}
					break;
				}
				if($F!='tag1' && $F!='tag2')$row_shalou[$F]=$D;
			}
			$setsql  = (is_array($sql))?','.implode(',',$sql):'';
			$jsonstr = encode_json($row_shalou);
			//
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr',photo_f=1 WHERE uid=".$uid);
			$hnbbs = dataIO($hnbbs,'in',2000);
			$photo_ifshow = intval($photo_ifshow);
			$db->query("UPDATE ".__TBL_USER__." SET photo_ifshow=$photo_ifshow,dataflag=1".$setsql.",hnbbs='$hnbbs' WHERE id=".$uid);
			set_data_ed_bfb($uid);
			//
			$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
			AddLog('修改用户【'.$nickname.'（uid:'.$uid.'）】个人资料');
			alert_adm("【个人资料】修改成功！",SELF."?submitok=mod&uid=$uid&t=$t&iframenav=$iframenav&ifmini=$ifmini");
		break;
		case 3:
			$mob  = trimhtml($mob);
			$mob2 = trimhtml($mob2);
			$address    = dataIO($address,'in',100);
			$qq         = dataIO($qq,'in',15);
			$weixin     = dataIO($weixin,'in',50);
			$email      = dataIO($email,'in',50);
			$mob        =(!ifmob($mob))?0:$mob;
			$mob2       =(!ifmob($mob2))?0:$mob2;
			$longitude = dataIO($longitude,'in',100);
			$latitude  = dataIO($latitude,'in',100);
			$weixin_pic = $row_shalou['weixin_pic'];
			if(ifmob($mob) && ifmob($mob2) && $mob==$mob2)alert_adm("两个手机号不能一样哦","-1");
			//
			$setsql .= ",longitude='$longitude',latitude='$latitude',address='$address',weixin='$weixin',qq='$qq',email='$email',weixin_pic='$weixin_pic'";
			if ($mob != $mob_old && ifmob($mob)){
				$row = $db->ROW(__TBL_USER__,'id',"(mob='$mob' AND mob<>'') OR (mob2='$mob' AND mob2<>'')","num");// AND FIND_IN_SET('mob',RZ)
				if($row){alert_adm("“手机：".$mob."”已被【UID：".$row[0]."】占用","-1");}else{$setsql .= ",mob='$mob'";}
			}else{
				$setsql .= ",mob='$mob'";
			}
			if ($mob2 != $mob2_old && ifmob($mob2)){
				$row = $db->ROW(__TBL_USER__,'id',"(mob='$mob2' AND mob<>'') OR (mob2='$mob2' AND mob2<>'')","num");// AND FIND_IN_SET('mob',RZ)
				if($row){alert_adm("“手机：".$mob2."”已被【UID：".$row[0]."】占用","-1");}else{$setsql .= ",mob2='$mob2'";}
			}else{
				$setsql .= ",mob2='$mob2'";
			}
			$row_shalou['address'] = $address;
			$row_shalou['qq'] = $qq;
			$row_shalou['weixin'] = $weixin;
			$row_shalou['email'] = $email;
			$jsonstr = encode_json($row_shalou);
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$uid);
			$db->query("UPDATE ".__TBL_USER__." SET dataflag=1".$setsql." WHERE id=".$uid);
			//
			$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
			AddLog('修改用户【'.$nickname.'（uid:'.$uid.'）】联系方式');
			alert_adm("【联系方式】修改成功！",SELF."?submitok=mod&uid=$uid&t=$t&iframenav=$iframenav&ifmini=$ifmini");
		break;
		case 4:
			$sql = array();
			if(count($mate_diy) >= 1 && is_array($mate_diy)){
				foreach ($mate_diy as $F) {
					switch ($F) {
						case 'areaid':
							$row_shalou['mate_areaid']   =$mate_areaid;
							$row_shalou['mate_areatitle']=$mate_areatitle;
							$sql[] = "mate_areaid = '".$mate_areaid."'";
							$sql[] = "mate_areatitle = '".$mate_areatitle."'";
						break;
						case 'areaid2':
							$row_shalou['mate_areaid2']   =$mate_areaid2;
							$row_shalou['mate_areatitle2']=$mate_areatitle2;
							$sql[] = "mate_areaid2 = '".$mate_areaid2."'";
							$sql[] = "mate_areatitle2 = '".$mate_areatitle2."'";
						break;
						default:
							$ext = mate_diy_par($F,'ext');
							if($ext=='radiorange'){
								$F1='mate_'.$F.'1';
								$F2='mate_'.$F.'2';
								$row_shalou[$F1]=$$F1;
								$row_shalou[$F2]=$$F2;
								//
								$sql[] = "$F1 = '".$$F1."'";
								$sql[] = "$F2 = '".$$F2."'";
							}elseif($ext=='checkbox'){
								$tmp = 'mate_'.$F;
								$list=$$tmp;
								$list = (is_array($list))?implode(',',$list):'';
								$row_shalou[$tmp]=$list;
								$sql[] = "$tmp = '".$list."'";
							}else{
								$tmp = 'mate_'.$F;
								$row_shalou[$tmp]=$$tmp;
								$sql[] = "$tmp = '".$$tmp."'";
							}
						break;
					}
				}
				$setsql = (is_array($sql))?','.implode(',',$sql):'';
			}
			$jsonstr = encode_json($row_shalou);
			$mate_other=trimhtml(dataIO($mate_other,'in',500));
			//
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr',addtime=".ADDTIME." WHERE uid=".$uid);
			$db->query("UPDATE ".__TBL_USER__." SET mate_other='$mate_other',dataflag=1".$setsql." WHERE id=".$uid);
			set_data_ed_bfb($uid);
			//
			$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
			AddLog('修改用户【'.$nickname.'（uid:'.$uid.'）】择偶要求');
			alert_adm("【择偶要求】修改成功！",SELF."?submitok=mod&uid=$uid&t=$t&iframenav=$iframenav&ifmini=$ifmini");
		break;
		case 6:
			if (count($rz_dataARR) >= 1 && is_array($rz_dataARR)){
				$ifadm = $session_truename.' (ID:'.$session_uid.')';
				foreach ($rz_dataARR as $k=>$V) {
					$bz = 'bz_'.$V;$bz = $$bz;
					$oldbz = 'oldbz_'.$V;$oldbz = $$oldbz;
					$FILES1 = $_FILES['pic_'.$V.'1'];
					$FILES2 = $_FILES['pic_'.$V.'2'];
					if(!empty($bz) || !empty($FILES1['tmp_name']) || !empty($FILES2['tmp_name'])){
						$row = $db->ROW(__TBL_RZ__,"id","uid=".$uid." AND rzid='$V'");
						if (!$row){
							$db->query("INSERT INTO ".__TBL_RZ__."  (uid,rzid,flag,addtime,ifadm) VALUES ($uid,'$V',0,".ADDTIME.",'".$ifadm."')");	
						}
					}
					$sql = "";
					if (!empty($FILES1['tmp_name'])){
						$dbname1 = setphotodbname('rz',$FILES1['tmp_name'],$uid.'_RZ_');
						@up_send($FILES1,$dbname1,0,'3000*3000',$uid.'_RZ_');
						$sql = ",path_b='$dbname1'";
					}
					//
					if (!empty($FILES2['tmp_name'])){
						$dbname2 = setphotodbname('rz',$FILES2['tmp_name'],$uid.'_RZ_');
						@up_send($FILES2,$dbname2,0,'3000*3000',$uid.'_RZ_');
						$sql .= ",path_b2='$dbname2'";
					}
					if(!empty($bz) && $oldbz!=$bz)$sql .= ",bz='$bz'";
					if(!empty($sql))$db->query("UPDATE ".__TBL_RZ__." SET ifadm='".$ifadm."',flag=1".$sql." WHERE uid=".$uid." AND rzid='$V'");
				}
				$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
				AddLog('修改【'.$nickname.'（uid:'.$uid.'）】认证资料');
			}
			alert_adm("<b class=\"S16\">操作成功！</b>",SELF."?submitok=mod&uid=$uid&t=$t&iframenav=$iframenav&ifmini=$ifmini");
			exit;
		break;
		default:exit;break;
	}
/******************************* 显示 ******************************/
}elseif($submitok == 'mod' || $submitok == 'photo'){
	$t = (ifint($t,'1-6','1'))?$t:1;
	$currfields     = "*";
	switch ($t) {
		case 1:
			$mini_title  = '帐号信息';
		break;
		case 2:
			$mini_title  = '个人资料';
			if (@count($extifshow) == 0 || !is_array($extifshow))alert_adm('暂无详细资料，请去主后台点击右上角【设置】左侧【资料属性】->【详细资料字段】添加字段，并更新数据缓存！','back');
		break;
		case 3:
			$mini_title  = '联系方法';
			set_data_ed_bfb($uid);
		break;
		case 4:
			$mini_title  = '择偶要求';
		break;
		case 6:
			$mini_title  = '线下认证资料备注';
		break;
	}
	//非超管门店+地区 
	if($session_kind == 'crm')$SQL = getAgentSQL();
	$row = $db->ROW(__TBL_USER__,$currfields,"id=".$uid.$SQL);
	if(!$row && $session_kind == 'crm')alert_adm("UID号有误/不存在此会员/不允许跨门店操作","back");
	$agentid = intval($row['agentid']);
	$admid   = intval($row['admid']);
	if($session_kind == 'crm' && !in_array('crm_user_mod',$QXARR) && in_array('crm_user_mod_my',$QXARR)){
		//if($admid!=$session_uid)exit(noauth('您只能修改自己名下的客户'));
		if(!ifmyu($uid))exit(noauth('您只能修改自己名下的客户'));
	}
	$hnid    = intval($row['hnid']);
	$hnid2   = intval($row['hnid2']);
	$grade    = $row['grade'];
	$photo_f  = $row['photo_f'];
	$RZ = $row['RZ'];$RZarr = explode(',',$RZ);
	$myinfobfb= $row['myinfobfb'];
	$regtime    = YmdHis($row['regtime']);
	$regip      = $row['regip'];
	$endtime    = YmdHis($row['endtime']);
	$endip      = $row['endip'];
	$click      = $row['click'];
	$photo_s    = $row['photo_s'];
	$nickname   = trimhtml(dataIO($row['nickname'],'out'));
	$sex        = $row['sex'];
	$ifadm      = $row['ifadm'];
	$kind       = $row['kind'];
	$flag       = $row['flag'];
	$photo_ifshow = $row['photo_ifshow'];
	$xqk_ifshow = $row['xqk_ifshow'];
	$uname      = dataIO($row['uname'],'out');
	$openid     = dataIO($row['openid'],'out');
	$unionid    = dataIO($row['unionid'],'out');
	$loginkey   = dataIO($row['loginkey'],'out');
	$pwd        = dataIO($row['pwd'],'out');
	$hnbbs      = dataIO($row['hnbbs'],'wx');
	$tguid      = $row['tguid'];
	$subscribe  = $row['subscribe'];
	$longitude  = $row['longitude'];
	$latitude   = $row['latitude'];
	$dataflag   = $row['dataflag'];
	$crm_yjnum  = $row['crm_yjnum'];
	$crm_ukind  = $row['crm_ukind'];
	$crm_fromclue  = $row['crm_fromclue'];	
	//
	$crm_qxnum = $row['crm_qxnum'];
	$hh_num    = $row['hh_num'];
	$rz_num    = $row['rz_num'];
	//
	//$crm_qxnumARR = json_decode($_VIP['qianxian_num'],true);
	//$hh_numARR    = json_decode($_VIP['hh_num'],true);
	//$rz_numARR    = json_decode($_VIP['rz_num'],true);
	//if($crm_qxnum==0 && $crm_qxnumARR[$grade]>0)$db->query("UPDATE ".__TBL_USER__." SET crm_qxnum=".intval($crm_qxnumARR[$grade])." WHERE id=".$uid);
	//if($hh_num==0 && $hh_numARR[$grade]>0)$db->query("UPDATE ".__TBL_USER__." SET hh_num=".intval($hh_numARR[$grade])." WHERE id=".$uid);
	//if($rz_num==0 && $rz_numARR[$grade]>0)$db->query("UPDATE ".__TBL_USER__." SET rz_num=".intval($rz_numARR[$grade])." WHERE id=".$uid);
	//
	$mob        = dataIO($row['mob'],'out');
	$mob2       = dataIO($row['mob2'],'out');
	$mate_other = trimhtml(dataIO($row['mate_other'],'out'));
	$data_mob_ifshow        = $row['mob_ifshow'];
	$data_qq_ifshow         = $row['qq_ifshow'];
	$data_weixin_ifshow     = $row['weixin_ifshow'];
	$data_weixin_pic_ifshow = $row['weixin_pic_ifshow'];
	$data_email_ifshow      = $row['email_ifshow'];
	$data_mob               = $mob;
	$data_mob2              = $mob2;
	switch ($grade) {
		case 1:$gradestyle   = " class='aHUI'";break;
		case 2:$gradestyle   = " class='aLAN'";break;
		case 3:$gradestyle   = " class='aZI'";break;
		case 4:$gradestyle   = " class='aHUANG'";break;
		case 5:$gradestyle   = " class='aJIN'";break;
		case 6:$gradestyle   = " class='aHONG'";break;
		case 7:$gradestyle   = " class='aLV'";break;
		case 8:$gradestyle   = " class='aHEI'";break;
		case 9:$gradestyle   = " class='aQING'";break;
		case 10:$gradestyle  = " class='aQINGed'";break;
	}
	//
	$uhref = a('{"kind":"crm_u","uid":$uid}');
	$title = $nickname;
	if(empty($nickname)){
		if(ifmob($mob)){
			$title = $mob;
		}else{
			$title = $truename;
		}
	}
	$mob = (!empty($mob))?$mob:'';
	if(!empty($photo_s)){
		$photo_m_url = smb(UP.$photo_s,'m');
		$photo_b_url = smb(UP.$photo_s,'b');
		$photo_m_str = '<img src="'.$photo_m_url.'?'.ADDTIME.'">';
	}else{
		$photo_m_url = RES.'photo_m'.$sex.'.png';
		$photo_m_str = '<img src="'.$photo_m_url.'">';
	}	
	$photo_fstr = ($photo_f == 0 && !empty($photo_s))?'<span>审核中</span>':'';
	
}elseif($submitok == 'zeai_up'){
	if (ifpostpic($file['tmp_name'])){
		$dbpicname = setphotodbname('tmp',$file['tmp_name'],'',$uid);/*$tmp*/
		if (!up_send($file,$dbpicname,$_UP['ifwaterimg'],$_UP['upBsize']))json_exit(array('flag'=>0,'msg'=>'上传图片失败'));
		if (!ifpic(UP.$dbpicname))alert_adm("图片格式错误","-1");
		json_exit(array('flag'=>1,'tmpphoto'=>$dbpicname));
	}else{
		json_exit(array('flag'=>0));
	}
}elseif($submitok == 'photo_s_shalou_del'){
	$path_s_new = $row_shalou['photo_s'];
	$row = $db->ROW(__TBL_USER__,"photo_s,nickname,openid,subscribe","id=".$uid);
	if ($row){
		$path_s = $row[0];$data_nickname = trimhtml(dataIO($row[1],'out'));$data_openid = $row[2];$data_subscribe = $row[3];
		if ($path_s!=$path_s_new){
			$path_m_new = smb($path_s_new,'m');$path_b_new = smb($path_s_new,'b');$path_blue_new = smb($path_s_new,'blur');
			@up_send_admindel($path_s_new.'|'.$path_m_new.'|'.$path_b_new.'|'.$path_blue_new);
		}
		$row_shalou['photo_s']='';
		$row_shalou=encode_json($row_shalou);
		$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$row_shalou' WHERE uid=".$uid);
		AddLog('删除用户【'.$data_nickname.'（uid:'.$uid.'）】沙漏头像');
	}
	alert_adm("删除成功！",SELF."?submitok=mod&uid=$uid&t=2&iframenav=$iframenav&ifmini=$ifmini");
}elseif($submitok == 'del_photo_s_update########'){
	$SHALOU_ARR=shalou_data($uid);
	if (!empty($SHALOU_ARR)){
		$path_s = $SHALOU_ARR['photo_s'];
		//$dataflag= $SHALOU_ARR['dataflag'];
	}
	if (!empty($path_s)){
		$path_m = smb($path_s,'m');$path_b = smb($path_s,'b');$path_blur = str_replace("_b.","_blur.",$path_b);
		@up_send_admindel($path_s.'|'.$path_m.'|'.$path_b.'|'.$path_blur);
		$SHALOU_ARR['photo_s']='';
		$jsonstr = encode_json($SHALOU_ARR);
		$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr',addtime=".ADDTIME." WHERE uid=".$uid);
	}
	$rt = $db->query("SELECT photo_s,nickname FROM ".__TBL_USER__." WHERE id=".$uid);
	if($db->num_rows($rt)){
		$row = $db->fetch_array($rt);
		$path_s = $row[0];$nickname= $row[1];
		if (!empty($path_s)){/* && $dataflag==1*/
			$path_m = smb($path_s,'m');$path_b = smb($path_s,'b');$path_blur = str_replace("_b.","_blur.",$path_b);
			@up_send_admindel($path_s.'|'.$path_m.'|'.$path_b.'|'.$path_blur);
		}
		$db->query("UPDATE ".__TBL_USER__." SET photo_s='',photo_f=0 WHERE id=".$uid);
		set_data_ed_bfb($uid);
	}
	//
	$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
	AddLog('删除用户【'.$nickname.'（uid:'.$uid.'）】头像');
	header("Location: ".SELF."?submitok=mod&uid=".$uid);
}elseif($submitok == 'ajax_photo_up'){
	if (ifpostpic($file['tmp_name'])){
		$dbpicname = setphotodbname('photo',$file['tmp_name'],$uid.'_');
		$_s = setpath_s($dbpicname);
		if (!up_send($file,$dbpicname,$_UP['ifwaterimg'],$_UP['upSsize'],$_UP['upBsize']))alert_adm("图片写入失败","");
		if (!ifpic(UP.$_s))alert_adm("图片格式错误","-1");
		$db->query("INSERT INTO ".__TBL_PHOTO__." (uid,path_s,flag,addtime) VALUES ($uid,'$_s',1,".ADDTIME.")");
		//
		$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
		AddLog('上传用户【'.$nickname.'（uid:'.$uid.'）】相册');
		json_exit(array('flag'=>1,'tmpphoto'=>$dbpicname));
	}else{
		json_exit(array('flag'=>0));
	}
}elseif($submitok == 'ajax_photo_del'){
	$row = $db->ROW(__TBL_PHOTO__,"path_s","id=".$id);
	if ($row){
		$path_s = $row[0];
		if (!empty($path_s)){
			$path_b = smb($path_s,'b');
			@up_send_admindel($path_s.'|'.$path_b);
			$db->query("DELETE FROM ".__TBL_PHOTO__." WHERE id=".$id);
			//
			$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
			AddLog('删除用户【'.$nickname.'（uid:'.$uid.'）】相册');
		}
	}exit;
}elseif($submitok == 'ajax_weixin_pic_up'){
	if (ifpostpic($file['tmp_name'])){
		$dbpicname = setphotodbname('photo',$file['tmp_name'],$uid.'_wxpic_');
		if (!up_send($file,$dbpicname,0,$_UP['upBsize']))json_exit(array('flag'=>0,'msg'=>'图片写入失败'));
		if (!ifpic(UP.$dbpicname))json_exit(array('flag'=>0,'msg'=>'图片格式错误'));
		
		$row_shalou['weixin_pic']=$dbpicname;
		$jsonstr=encode_json($row_shalou);
		$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$uid);
		//$db->query("UPDATE ".__TBL_USER__." SET weixin_pic='$dbpicname' WHERE id=".$uid);
		//
		$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
		AddLog('上传用户【'.$nickname.'（uid:'.$uid.'）】微信二维码');
		json_exit(array('flag'=>1,'tmpphoto'=>UP.$dbpicname));
	}else{
		json_exit(array('flag'=>0,'msg'=>'zeai_tmp_name_error'));
	}
}elseif($submitok == 'ajax_weixin_pic_del'){
	$row = $db->NUM($uid,"weixin_pic");
	$data_weixin_pic = $row[0];
	$weixin_pic      = $row_shalou['weixin_pic'];
	if (!empty($weixin_pic)){
		$row_shalou['weixin_pic']='';
		$jsonstr=encode_json($row_shalou);
		$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$uid);
		if($data_weixin_pic!=$weixin_pic)@up_send_admindel($data_weixin_pic);
	}
	//
	$row2 = $db->ROW(__TBL_USER__,"nickname","id=".$uid,'num');$nickname= $row2[0];
	AddLog('删除用户【'.$nickname.'（uid:'.$uid.'）】微信二维码');
	json_exit(array('flag'=>1,'msg'=>'删除成功！'));
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="<?php echo HOST;?>/res/www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/udata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/areadata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/res/select4.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php if($t == 4){?>
	<script>
	var nulltext = '不限';
	var mate_areaid_ARR1 = areaARR1,
	mate_areaid_ARR2 = areaARR2,
	mate_areaid_ARR3 = areaARR3,
	mate_areaid_ARR4 = areaARR4;
	var mate_areaid2_ARR1 = areaARRhj1,
	mate_areaid2_ARR2 = areaARRhj2,
	mate_areaid2_ARR3 = areaARRhj3,
	mate_areaid2_ARR4 = areaARRhj4;
	var
	mate_age_ARR  = age_ARR,
	mate_age_ARR1 = age_ARR,
	mate_age_ARR2 = age_ARR,
	mate_heigh_ARR  = heigh_ARR,
	mate_heigh_ARR1 = heigh_ARR,
	mate_heigh_ARR2 = heigh_ARR,
	mate_weigh_ARR  = weigh_ARR,
	mate_weigh_ARR1 = weigh_ARR,
	mate_weigh_ARR2 = weigh_ARR,
	mate_pay_ARR = pay_ARR,
	mate_edu_ARR = edu_ARR,
	mate_love_ARR = love_ARR,
	mate_job_ARR = job_ARR,
	mate_house_ARR = house_ARR,
	mate_child_ARR = child_ARR,
	mate_marrytime_ARR = marrytime_ARR,
	mate_companykind_ARR = companykind_ARR,
	mate_smoking_ARR = smoking_ARR,
	mate_drink_ARR = drink_ARR,
	mate_car_ARR = car_ARR;
    </script>
<?php }?>
<script>
function cut(id,nkname,p) {zeai.iframe('裁切【'+nkname+'】主头像','u_photo_cut.php?ifm=shalou&id='+uid+'&submitok=www___zeai__cn_inphotocut'+'&p='+p,650,560);}
var upMaxMB = <?php echo $_UP['upMaxMB']; ?>,t=<?php echo intval($t); ?>;
var uid = '<?php echo $uid; ?>';
function up_m(id,nkname) {
	var pic = o('pic');
	pic.click();
	pic.onchange = function(){
		var FILES = pic.files[0];
		if (FILES['size'] > upMaxMB*1024000){pic.value='';zeai.alert('图片【'+FILES['name']+'】太大，已超过'+upMaxMB+'M，请重新选择');return false;}
		var filename = FILES['name'].toLowerCase();
		var ftype    = filename.substring(filename.lastIndexOf("."),filename.length);
		if ((ftype != '.jpg')&&(ftype != '.jpeg')&&(ftype != '.gif')&&(ftype != '.png')){pic.value='';zeai.alert('只能上传 .jpg 或 .gif 格式的图片,请重新选择!');return false;}
		setTimeout(zeai.msg('<img src="images/loadingData.gif" class="picmiddle">图片【'+FILES['name']+'】正在上传中',{time:30}),300);
		//POST
		var postjson = {"submitok":"zeai_up","file":FILES,"uid":uid};
		zeai.ajax({url:'u_mod_data'+zeai.ajxext,data:postjson},function(e){var rs=zeai.jsoneval(e);
			pic.value='';
			zeai.msg(0);
			if (rs.flag == 1){
				zeai.iframe('裁切【'+nkname+'】主头像','u_photo_cut.php?ifm=shalou&id='+uid+'&submitok=www___zeai__cn_inphotocut&tmpphoto='+rs.tmpphoto,720,720);
			}else{
				zeai.alert(rs.msg);
				//zeai.alert('上传图片出错，请联系原作者QQ：797311');
			}
		});
	}
}
checkboxMaxNum=88;
nulltext='--';
</script>
<link href="css/main.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css">
<style>
.noU58{position:relative}
.noU58 span{display:block;width:100%;line-height:24px;position:absolute;top:17px;background-color:rgba(0,0,0,0.4);color:#ccc;font-size:12px}
/*uidsobox*/
.uidsobox{margin:100px auto 0 auto;border:#eee 1px solid;width:700px;line-height:100px;background-color:#f8f8f8}
.uidsobox .input{height:30px;line-height:30px}
/*table*/
.table {background-color:#fff}
.table td{padding:8px;border-bottom:1px solid #F0F3F6}

a.noUW200 img{max-width:200px;display:block;cursor:zoom-in;}
.sexRW li{width:45%}
.SW{width:150px}
.table .tdL{width:100px;background-color:#fafafa}
.table .tdR{min-width:250px}
.table .tbodyT{font-size:18px}
.rzboxx li{width:250px;max-height:100px;float:left;text-align:center}
.rzboxx li input{width:88%;margin-top:20px;padding:0 1px;color:#999}
.rzboxx li textarea{width:90%;float:right}
.RZBOX{width:80%;margin:0 auto}
</style>
</head>
<body class="body">
<?php if ($iframenav != 1){?>
<div class="navbox">
    <?php if ($ifmini != 1){?><a style="display:none" href="<?php echo SELF; ?>?uid=<?php echo $uid; ?>"<?php echo (empty($t))?' class="ed"':''; ?>>按用户ID号查询</a><?php }?>
    <?php if ($session_kind != 'crm'){?><a href="<?php echo SELF; ?>?submitok=mod&ifmini=<?php echo $ifmini;?>&t=1&uid=<?php echo $uid; ?>"<?php echo ($t == 1)?' class="ed"':''; ?>>基本信息</a><?php }?>
    <a href="<?php echo SELF; ?>?submitok=mod&ifmini=<?php echo $ifmini;?>&t=2&uid=<?php echo $uid; ?>"<?php echo ($t == 2)?' class="ed"':''; ?>>个人资料</a>
    <a href="<?php echo SELF; ?>?submitok=mod&ifmini=<?php echo $ifmini;?>&t=4&uid=<?php echo $uid; ?>"<?php echo ($t == 4)?' class="ed"':''; ?>>择偶要求</a>
    <a href="<?php echo SELF; ?>?submitok=mod&ifmini=<?php echo $ifmini;?>&t=3&uid=<?php echo $uid; ?>"<?php echo ($t == 3)?' class="ed"':''; ?>>联系方法</a>
    <a href="<?php echo SELF; ?>?submitok=photo&ifmini=<?php echo $ifmini;?>&t=5&uid=<?php echo $uid; ?>"<?php echo ($t == 5)?' class="ed"':''; ?>>个人相册</a>
    <a href="<?php echo SELF; ?>?submitok=rz&ifmini=<?php echo $ifmini;?>&t=6&uid=<?php echo $uid; ?>"<?php echo ($t == 6)?' class="ed"':''; ?>>认证资料</a>
<div class="clear"></div></div><div class="fixedblank"></div>
<?php }?>
<?php if (empty($submitok)){ ?>
<div class="uidsobox S16">
    <form action="<?php echo SELF; ?>" method="post">
    请输入用户ID号
    <input name="uid" type="text" class="size2 W150" id="uid" size="8" maxlength="9" value="<?php echo $uid; ?>"> 
    <input type="submit" name="Submit" value="提交" class="btn size2">
    <input name="submitok" type="hidden" value="mod" /></td>
    </form>
    </div>
<?php }else{?>

<form action="<?php echo SELF; ?>" method="post" id="supdesQQ797311_form" name="www_zeai.cn_FORM" onsubmit="return chkform();" enctype="multipart/form-data">
<table class="table0 W1200 Mtop30 Mbottom50 size2">
<tr>
<td width="210" align="right" valign="top" bgcolor="#ffffff"><table cellpadding="0" class="table0 " style="border:#F0F3F6 1px solid">
<tr>
<td align="center" style="padding:6px"><a href="javascript:;" class="noUW200 sex<?php echo $sex; ?>" onClick="parent.piczoom('<?php echo $photo_b_url; ?>');"><?php echo $photo_m_str; ?></a></td>
</tr>
<tr>
<td height="40" align="center" class="S14"><?php echo uicon($sex.$grade).$title; ?></td>
</tr>
<tr><td height="40" align="center" valign="top" class="S14 C999">UID：<?php echo $uid; ?></td></tr>



<tr><td height="40" align="center" valign="top" class="S14 C999">
<?php if($flag == 2){ ?><font class="C00f">注册未完成</font><br><?php }?>
资料完整度：<?php echo $myinfobfb; ?>％<br><br>
  </td>
</tr>
<?php 
if(ifint($admid)){
	$row = $db->ROW(__TBL_ADMIN__,"truename","id=".$admid);
	if ($row){
	?>
	<tr>
	<td height="40" align="center" valign="top" class="S14 C999"><?php $adm_truename=dataIO($row[0],'out');echo '录入/认领：'.dataIO($row[0],'out').'('.$admid.')';?></td>
	</tr>
	<?php 
	}
}
?>
<tr>
<td height="10" align="center" valign="bottom" onClick="zeai.openurl('cert_hand.php?submitok=show&memberid=<?php echo $uid; ?>&ifmini=1')" title="手动强制认证" class="hand"><?php echo RZ_html($RZ,'s','all');?></td>
</tr>

<?php if ($session_kind == 'adm'){?>
<tr><td height="50" align="center" valign="top"><a href="cert_hand.php?submitok=show&memberid=<?php echo $uid; ?>&ifmini=1" class="aBAI" title="手动强制点亮认证图标">手动点亮</a></td></tr>

<tr><td height="50" align="center" valign="bottom">
<a href="photo_m.php?uid=<?php echo $uid; ?>&submitok=updateendtime&p=<?php echo $p;?>&ifmini=1" title="置顶排名" class="aBAI">冒泡排名</a>
</td></tr>

<tr>
<td height="50" align="center" valign="bottom"><a href="u_mod_pass.php?uid=<?php echo $uid; ?>&title=【<?php echo $title; ?>】" class="aBAI">修改密码</a></td>
</tr>
<?php }?>
<tr>
  <td height="50" align="center" valign="bottom">
  
  

  <table class="table0 W80_ Mtop30">
    <tr><td height="30">人气：<?php echo $click; ?></td></tr>
    <tr><td height="30">注册：<?php echo $regtime; ?></td></tr>
    <tr><td height="30">注册IP：<?php echo $regip; ?></td></tr>
    <tr><td height="30">最近：<?php echo $endtime; ?></td></tr>
    <tr><td height="30">最近IP：<?php echo $endip; ?></td></tr>
</table>  

<?php if (!empty($longitude)){ ?>
<table class="table0 W80_ ">
    <tr>
      <td height="30">经度：<?php echo $longitude; ?></td>
      <td width="50" rowspan="2" align="left" valign="middle">
      <a href="http://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=<?php echo $longitude; ?>&pointy=<?php echo $latitude; ?>&name=当前位置&addr=当前位置&ref=myapp" target="_blank"><img src="images/gps.gif" style="display:inline"></a>
      </td>
    </tr>
    <tr>
      <td height="30">纬度：<?php echo $latitude; ?></td>
      </tr>
  </table>
<?php }?><br><br>
  
  </td>
</tr>

</table>

</td>
<td align="left" valign="top" style="padding:0">
<?php if ($submitok == 'photo'){ ?>
<!--个人相册-->
<style>
.picli{padding:20px}
.picli li{width:100px;height:100px;line-height:100px;border:#eee 1px solid;box-sizing:border-box;cursor:pointer;float:left;margin:0 59px 50px 0;text-align:center;position:relative}
.picli li:nth-child(6n){margin-right:0}
.picli li.add,.picli li i{background-image:url('images/picadd.png?3');background-size:120px 80px;background-repeat:no-repeat}
.picli li.add{background-size:150px 100px;background-repeat:no-repeat;background-position:-2px -2px;border:#dedede 2px dashed}
.picli li:hover{background-color:#f5f7f9}
.picli li img{vertical-align:middle;margin-top:-5px;max-width:98px;max-height:98px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;cursor:zoom-in}
.picli li:hover .img{cursor:zoom-in}
.picli li i{width:20px;height:20px;top:-10px;right:-10px;position:absolute;border-radius:10px;background-position:-80px top;display:block;box-shadow:0 0 5px rgba(0,0,0,0.3)}
.picli li i:hover{background-position:-100px top;cursor:pointer}
.picli #picmore{display:none}
</style>
<table class="table W98_">
    <tr><td height="20" class="tbodyT"><center>个人相册</center></td></tr>
    <tr>
    <td height="300" valign="top">
    <div class="picli">
    	<li class="add" id="add"><input id="picmore" type="file" accept="image/gif,image/jpeg,image/png" multiple /></li>
		<?php 
        $rt=$db->query("SELECT id,path_s FROM ".__TBL_PHOTO__." WHERE uid=".$uid." ORDER BY id DESC");
        $total = $db->num_rows($rt);
        if ($total>0) {
            for($i=1;$i<=$total;$i++) {
                $rows = $db->fetch_array($rt);
                if(!$rows) break;
				$id = $rows[0];$path_s = $rows[1];
                $dst_s  = UP.$path_s;
                $dst_b  = smb($dst_s,'b');
                ?>
                <li class="li"><img id="<?php echo $id;?>" src="<?php echo $dst_s;?>"><i></i></li>
            <?php
            }
            ?>
            <script>
                zeai.listEach('.li',function(obj){
                    var img = obj.children[0];
                    var i   = obj.children[1];
                    img.onclick = function(){parent.piczoom(img.src.replace('_s','_b'));}
					i.onclick = function(){
						zeai.confirm('亲~~确认删除么？',function(){
							obj.parentNode.removeChild(obj);
							zeai.ajax('u_mod_data'+zeai.ajxext+'submitok=ajax_photo_del&uid='+uid+'&id='+img.id);
						});
					}
                });
            </script>
        <?php }?>
        <script>
		add.onclick=function(){
			var picmore = o('picmore');
			picmore.click();
			picmore.onchange = function(){
				var FILES   = this.files;
				var Flength = FILES.length;
				if (Flength>10){
					zeai.alert('一次最多只能10张，否则会卡~~');
				}else{
					var filename,ftype;
					for(i=0;i<Flength;i++) {
						if (FILES[i]['size'] > upMaxMB*1024000){zeai.alert('图片【'+FILES[i]['name']+'】太大，已超过'+upMaxMB+'M，请重新选择');picmore.value='';return false;}
						filename = FILES[i]['name'].toLowerCase();ftype = filename.substring(filename.lastIndexOf("."),filename.length);
						if ((ftype != '.jpg')&&(ftype != '.gif')&&(ftype != '.png')){picmore.value='';zeai.alert('只能上传jpg/gif/png格式图片,请重新选择!');return false;}
					}
					var j=0;
					function photo_up(){
						parent.zeai.msg('<img src="images/loadingData.gif" class="picmiddle">正在上传第 '+(j+1)+' 张 -->'+FILES[j]['name'],{animation:'off',time:30})
						var postjson = {"submitok":"ajax_photo_up","file":FILES[j],"uid":uid};
						zeai.ajax({url:'u_mod_data'+zeai.ajxext,data:postjson},function(e){var rs=zeai.jsoneval(e);
							if (rs.flag == 1){
								j++;
								if (j < Flength){
									parent.zeai.msg(0);
									setTimeout(photo_up,300);
								}else{picmore.value='';parent.zeai.msg(0);parent.zeai.msg('全部上传成功，正在刷新数据...');location.reload(true);}
							}else{
								zeai.alert('【'+FILES[j]['name']+'】上传出错，请联系原作者QQ：797311');
							}
						});
					}
					photo_up();
				}
			}
		}
        </script>
    </div>
    </td>
    </tr>
</table>
<!--个人相册 结束-->
<?php }else{ ?>
<!--基本资料，详细资料，择偶要求-->
	<style>
	.flagstrcls{font-weight:normal;line-height:100%;font-size:12px}
	/*关注*/
	.my-subscribe_box{padding:15px 15px 30px 15px;background-color:#fff;border-radius:12px;display:none}
	.my-subscribe_box img{width:240px;height:240px;padding:2px;border:#eee 1px solid;display:block;margin:20px auto}
	.my-subscribe_box h3{display:inline-block;line-height:30px;font-size:14px;margin-top:0px}
    </style>
    <table class="table W98_ size2" style="border:#F0F3F6 1px solid">
    <tr><td height="20" colspan="4" class="tbodyT"><center><?php echo $mini_title;
	if ($t == 2){
		$shaloubfb=get_shalou_ed_bfb($row_shalou).'％';
		if ($dataflag == 0){
			echo '<div class="flagstrcls Cf00">个人资料审核中　沙漏：'.$shaloubfb.'</div>';	
		}elseif($dataflag == 2){
			echo '<div class="flagstrcls C00f">已驳回　沙漏：'.$shaloubfb.'</div>';
		}elseif($dataflag == 1){
			echo '<div class="flagstrcls C090">已审核　沙漏：'.$shaloubfb.'</div>';
		}
	}elseif($t == 6){
		echo '<div class="flagstrcls Cf00">以下认证照片上传后不可更改删除（如需修改，请联系管理员）</div>';
		
	}
	?></center></td></tr>
    <!-- 基本资料 -->
    <?php if ($t == 1){ ?>
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
        <td class="tdL">前台管理员</td>
        <td colspan="3" class="tdR">
        <input type="checkbox" name="ifadm" id="ifadm" class="switch" value="1"<?php echo ($ifadm == 1)?' checked':'';?>><label for="ifadm" class="switch-label"><i></i><b>是</b><b>否</b></label>　<span class="tips2 S12">选“是”手机端用户主页将有管理功能【生成相亲卡】【隐藏】【封号】【置顶】【置底】新用户注册审核微信通知提醒功能(需关注公众号)</span>      
        </td>
    </tr>
 
     <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
        <td class="tdL">公众号关注</td>
        <td class="tdR">
        <input type="checkbox" name="subscribe" id="subscribe" class="switch" value="1"<?php echo ($subscribe == 1)?' checked':'';?>><label for="subscribe" class="switch-label"><i></i><b>已关注</b><b>未关注</b></label>
		<span class="tips S12">如果已关注或公众号老粉丝可以设置为<font style="color:#5EB87B">已关注</font></span>
		</td>
        <td class="tdL">绑定微信</td>
        <td class="tdR">
			<?php if (!empty($openid)){?>
                <button type="button" onClick="zeaiBindWeixin(<?php echo $uid;?>,'openid_cancel');" class="btn size2 HUI">解除绑定</button>
                <?php echo '　<font class="S12">OPENID：'.$openid.'</font>';if($subscribe==2)echo'<font class="C00f S12">（已取消关注）</font>';
            }else{ ?>
                <button type="button" onClick="zeaiBindWeixin(<?php echo $uid;?>,'openid_bind');" class="btn size2"><i class="ico">&#xe607;</i> 立即绑定</button>
                <div id="subscribe_box_my_set" class="my-subscribe_box">
                    <img id="Z_e___A___I__c___N" src="<?php echo HOST;?>/sub/creat_ewm.php?url=<?php echo HOST."/m/u_openid_bind.php?submitok=ewm&uid=".$uid;?>&u=<?php echo $session_uid;?>&p=<?php echo md5($session_pwd.'ZEAI.cn');?>">
                    <h3><i class="ico picmiddle S18" style="color:#45C01A">&#xe607;</i> <span class="picmiddle S14">请使用客户手机打开微信扫码</span><br>绑定成功后可以用微信登录进入当前用户帐号</h3>
                </div>
            <?php }?>
			<script>
            function zeaiBindWeixin(uid,type){
                if(type=='openid_bind'){
					zeai.div({obj:o('subscribe_box_my_set'),title:'绑定微信',w:400,h:450});
					setInterval(function(){chk_openid_bind(uid);},2000);
                }else if(type=='openid_cancel'){
                    zeai.confirm('确定解除绑定么？',function(){
                        zeai.ajax({url:'u_mod_data'+zeai.ajxext+'submitok=ajax_openid_bind_cancel&uid='+uid},function(e){var rs=zeai.jsoneval(e);
                            zeai.msg(rs.msg);
                            if(rs.flag==1){setTimeout(function(){location.reload(true);},1000);}
                        });
                    });
                }
                function chk_openid_bind(uid){
                    zeai.ajax({url:'u_mod_data'+zeai.ajxext+'submitok=ajax_openid_bind&uid='+uid},function(e){var rs=zeai.jsoneval(e);
                        if(rs.flag==1){
							zeai.msg(rs.msg);setTimeout(function(){location.reload(true);},1500);
						}
                    });
                }
            }
            </script>     
        </td>
     </tr>

    <tr>
      <td class="tdL">用户类型</td>
      <td colspan="3" class="tdR" style="line-height:200%">
      
<input type="radio" name="kind" value="1" id="kind_1" class="radioskin"<?php echo ($kind == 1)?' checked':'';?>><label for="kind_1" class="radioskin-label"><i class="i1"></i><b class="W120">线上用户</b></label><span class="tips S12">用户自主联系互动，和用户自己注册效果一样</span><br>
<input type="radio" name="kind" value="2" id="kind_2" class="radioskin"<?php echo ($kind == 2)?' checked':'';?>><label for="kind_2" class="radioskin-label"><i class="i1"></i><b class="W120">线下用户</b></label><span class="tips S12">内部用户，网站前台只展示，别的用户联系必须通过红娘，不可登录互动，后台/CRM人工管理服务</span><br>
<input type="radio" name="kind" value="3" id="kind_3" class="radioskin"<?php echo ($kind == 3)?' checked':'';?>><label for="kind_3" class="radioskin-label"><i class="i1"></i><b class="W120">均可(线上+线下)</b></label><span class="tips S12">都可以，如果线上用户申请红娘委托之后，将自动变为这种类型，后台/CRM人工管理服务</span><br>

<input type="radio" name="kind" value="4" id="kind_4" class="radioskin"<?php echo ($kind == 4)?' checked':'';?>><label for="kind_4" class="radioskin-label"><i class="i1"></i><b class="W120">机器人</b></label><span class="tips S12">虚拟人，用来自动发私信和打招呼给新注用户的，也就是虚拟用户</span>
      
      </td>
      
    <tr>
    <td class="tdL">帐号状态</td>
    <td colspan="3" class="tdR">
        <input type="radio" name="flag" value="1" id="flag1" class="radioskin"<?php echo ($flag == 1)?' checked':'';?>><label for="flag1" class="radioskin-label"><i class="i1"></i><b class="W50">正常</b></label>
        <input type="radio" name="flag" value="-2" id="flag_2" class="radioskin"<?php echo ($flag == -2)?' checked':'';?>><label for="flag_2" class="radioskin-label"><i class="i1"></i><b class="W50">隐藏</b></label>
        <input type="radio" name="flag" value="-1" id="flag_1" class="radioskin"<?php echo ($flag == -1)?' checked':'';?>><label for="flag_1" class="radioskin-label"><i class="i1"></i><b class="W100">锁定(已注销)</b></label>
        <input type="radio" name="flag" value="0" id="flag0" class="radioskin"<?php echo ($flag == 0)?' checked':'';?>><label for="flag0" class="radioskin-label"><i class="i1"></i><b class="W50">未审</b></label>
        <input type="radio" name="flag" value="2" id="flag2" class="radioskin"<?php echo ($flag == 2)?' checked':'';?>><label for="flag2" class="radioskin-label"><i class="i1"></i><b class="W100">注册未完成</b></label>
        
        <span class="FR" style="display:inline-block;margin-right:20px;display:none">手机个人主页相亲卡海报推广：<input type="checkbox" name="xqk_ifshow" id="xqk_ifshow" class="switch" value="1"<?php echo ($xqk_ifshow == 1)?' checked':'';?>><label for="xqk_ifshow" class="switch-label"><i></i><b>显示</b><b>隐藏</b></label></span>
    </td>
    </tr>

    <tr>
      <td class="tdL">登录用户名</td>
      <td class="tdR"><input name="uname" type="text" class="W150" id="uname" value="<?php echo $uname;?>" maxlength="100" /></td>
      <td class="tdL">前台头像</td>
      <td class="tdR"><input type="checkbox" name="photo_ifshow" id="photo_ifshow" class="switch" value="1"<?php echo ($photo_ifshow == 1)?' checked':'';?>><label for="photo_ifshow" class="switch-label"><i></i><b>显示</b><b>隐藏</b></label></td>
    </tr>
    
    <tr>
      <td class="tdL">自助发起牵线</td>
      <td class="tdR"><input type="text" maxlength="5" class="input size2 W80" name="crm_qxnum" id="crm_qxnum" value="<?php echo $crm_qxnum; ?>" /> 次<span class="tips S12">用户主动发起红娘牵线总次数</span></td>
      <td class="tdL">需成功约见</td>
      <td class="tdR"><input type="text" maxlength="5" class="input size2 W80" name="crm_yjnum" id="crm_yjnum" value="<?php echo $crm_yjnum; ?>" /> 次<span class="tips S12">内部红娘使用标记</span></td>
    </tr>
    <tr>
      <td class="tdL">自助发起互换</td>
      <td class="tdR"><input type="text" maxlength="5" class="input size2 W80" name="hh_num" id="hh_num" value="<?php echo $hh_num; ?>" /> 次<span class="tips S12">用户主动发起与对方互换微信手机总次数</span></td>
      <td class="tdL">自助认证免费</td>
      <td class="tdR"><input type="text" maxlength="5" class="input size2 W80" name="rz_num" id="rz_num" value="<?php echo $rz_num; ?>" /> 次<span class="tips S12">用户主动进行实名和真人认证免费总次数</span></td>
    </tr>
 
    <input name="photo_s" type="hidden" value="<?php echo $photo_s; ?>" />
    
    
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
      <td colspan="4" align="center" class="tbodyT"><center>CRM信息</center></td>
    </tr>
<!---->
<?php
if($crm_agentid=='无'){
	$agentid=0;
}else{
	$crm_agentid = intval($crm_agentid);
	$agentid     = ($crm_agentid>0)?$crm_agentid:$agentid;
}
?>
    <tr<?php echo (!in_array('crm',$QXARR))?' style="display:none"':'';?>>
        <td class="tdL">所属门店</td>
        <td colspan="3" class="tdR">
            <?php
			$rt2=$db->query("SELECT id,title FROM ".__TBL_CRM_AGENT__." WHERE flag=1 ORDER BY px DESC,id DESC");
			$total2 = $db->num_rows($rt2);
			?>
			<select name="agentid" class="W300 size2"  onChange="zeai.openurl('<?php echo SELF;?>?submitok=mod&ifmini=<?php echo $ifmini;?>&t=1&uid=<?php echo $uid;?>&crm_agentid='+this.value+'&ifbottom=1')">
			<option value="无">请选择门店</option>
			<?php
				for($j=0;$j<$total2;$j++) {
					$rows2 = $db->fetch_array($rt2,'num');
					if(!$rows2) break;
					$clss=($agentid==$rows2[0])?' selected':'';
					?>
					<option value="<?php echo $rows2[0];?>"<?php echo $clss;?>><?php echo dataIO($rows2[1],'out');?></option>
					<?php
				}
			?>
			</select><span class="tips">此为硬改用户主表，不触发其他任何关联</span>
        </td>
    </tr>
    <tr<?php echo (!in_array('crm',$QXARR))?' style="display:none"':'';?>>
        <td class="tdL">录入/认领</td>
        <td colspan="3" class="tdR">
            <?php
			$rt2=$db->query("SELECT id,username,truename FROM ".__TBL_CRM_HN__." WHERE flag=1 AND agentid=$agentid ORDER BY px DESC,id DESC");
			$total2 = $db->num_rows($rt2);
			?>
			<select name="admid" class="W300 size2">
			<option value="">请选择录入/认领人</option>
			<?php
				for($j=0;$j<$total2;$j++) {
					$rows2 = $db->fetch_array($rt2,'num');
					if(!$rows2) break;
					$clss=($admid==$rows2[0])?' selected':'';
					?>
					<option value="<?php echo $rows2[0];?>"<?php echo $clss;?>><?php echo dataIO($rows2[2],'out').'　｜　'.dataIO($rows2[1],'out').'　｜　ID:'.dataIO($rows2[0],'out');?></option>
					<?php
				}
			?>
			</select><span class="tips">此为硬改用户主表，不触发其他任何关联</span>
        </td>
    </tr>
    <tr<?php echo (!in_array('crm',$QXARR))?' style="display:none"':'';?>>
        <td class="tdL">售前</td>
        <td colspan="3" class="tdR">
            <?php
			$rt2=$db->query("SELECT id,username,truename  FROM ".__TBL_CRM_HN__." WHERE flag=1 AND FIND_IN_SET('sq',crmkind) AND agentid=$agentid ORDER BY px DESC,id DESC");
			$total2 = $db->num_rows($rt2);
			?>
			<select name="hnid" class="W300 size2">
			<option value="">请选择售前</option>
			<?php
				for($j=0;$j<$total2;$j++) {
					$rows2 = $db->fetch_array($rt2,'num');
					if(!$rows2) break;
					$clss=($hnid==$rows2[0])?' selected':'';
					?>
					<option value="<?php echo $rows2[0];?>"<?php echo $clss;?>><?php echo dataIO($rows2[2],'out').'　｜　'.dataIO($rows2[1],'out').'　｜　ID:'.dataIO($rows2[0],'out');?></option>
					<?php
				}
			?>
			</select><span class="tips">此为硬改用户主表，不触发其他任何关联</span>
        </td>
    </tr>
    <tr<?php echo (!in_array('crm',$QXARR))?' style="display:none"':'';?>>
        <td class="tdL">售后</td>
        <td colspan="3" class="tdR">
            <?php
			
			$rt2=$db->query("SELECT id,username,truename  FROM ".__TBL_CRM_HN__." WHERE flag=1 AND FIND_IN_SET('sh',crmkind) AND agentid=$agentid ORDER BY px DESC,id DESC");
			$total2 = $db->num_rows($rt2);
			?>
			<select name="hnid2" class="W300 size2">
			<option value="">请选择售后</option>
			<?php
				for($j=0;$j<$total2;$j++) {
					$rows2 = $db->fetch_array($rt2,'num');
					if(!$rows2) break;
					$clss=($hnid2==$rows2[0])?' selected':'';
					?>
					<option value="<?php echo $rows2[0];?>"<?php echo $clss;?>><?php echo dataIO($rows2[2],'out').'　｜　'.dataIO($rows2[1],'out').'　｜　ID:'.dataIO($rows2[0],'out');?></option>
					<?php
				}
			?>
			</select><span class="tips">此为硬改用户主表，不触发其他任何关联</span>
        </td>
    </tr>
    
    <?php if ($session_kind == 'crm' && in_array('crm_ukind',$QXARR) || $session_kind == 'adm'){?>
    <tr><td class="tdL">客户分类</td><td colspan="3" class="tdR"><script>zeai_cn__CreateFormItem('select','crm_ukind','<?php echo $crm_ukind; ?>','class="size2 W300"',crm_ukind_ARR);</script></td></tr>
    <?php }else{?>
    <input name="crm_ukind" type="hidden" value="<?php echo $crm_ukind; ?>" />
    <?php }?>
    
    <tr><td class="tdL">线索来源</td><td colspan="3" class="tdR"><script>zeai_cn__CreateFormItem('select','crm_fromclue','<?php echo $crm_fromclue; ?>','class="size2 W300"',crm_fromclue_ARR);</script></td></tr>
    
    <?php if (ifint($crm_agentid)){?><script>setTimeout(function(){zeai.setScrollTop(9999);},500);</script><?php }?>
    <!---->

    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>><td colspan="4" class="tbodyT"><center>
      登录密码
    </center></td></tr>
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>><td class="tdL">登录密码</td><td colspan="3" class="tdR"><input name="pwd" type="text" class="W300" id="pwd"/><span class="tips">不修改或没有请留空</span></td></tr>
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
      <td class="tdL">openid</td>
      <td colspan="3" class="tdR"><input name="openid" type="text" class="W300" id="openid" value="<?php echo $openid;?>" maxlength="100" /><span class="tips">微信登录用的，有值就已经绑定成功了，不懂勿动</span></td>
      </tr>
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
      <td class="tdL">unionid</td>
      <td colspan="3" class="tdR"><input name="unionid" type="text" class="W300" id="unionid" value="<?php echo $unionid;?>" maxlength="100" /><span class="tips">微信多端通行证登录用的，有值就已经绑定成功了，不懂勿动</span></td>
      </tr>
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
      <td class="tdL">loginkey</td>
      <td colspan="3" class="tdR"><input name="loginkey" type="text" class="W300" id="unionid" value="<?php echo $loginkey;?>" maxlength="100" /><span class="tips">QQ登录用的，有值就已经绑定成功了，不懂勿动</span></td>
      </tr>
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
    <td colspan="4" class="tbodyT"><center>推广分销</center></td>
    </tr>
    <tr<?php echo ($session_kind == 'crm')?' style="display:none"':'';?>>
    <td class="tdL">推荐人ID</td>
    <td colspan="3" class="tdR"><input name="tguid" type="text" class="W150" id="tguid" value="<?php echo $tguid; ?>">
<?php if (!empty($tguid)){
	$tgrow = $db->ROW(__TBL_TG_USER__,"nickname,title,kind","id=".$tguid,"name");
	if ($tgrow){
		$nickname_tg = dataIO($tgrow['nickname'],'out');
		$title_tg    = $tgrow['title'];
		$kind_tg     = $tgrow['kind'];
		if($kind_tg==2 || $kind_tg == 3){
			$nickname_tg=$title_tg;
		}
		echo $nickname_tg.'（ID:'.$tguid.'）';
	}
}
?>
    </td>
    </tr>

    <input name="submitok" type="hidden" value="modupdate" />
    <input name="uid" type="hidden" value="<?php echo $uid; ?>" />
    <input name="username_old" type="hidden" value="<?php echo $uname; ?>" />
    <input name="openid_old" type="hidden" value="<?php echo $openid; ?>" />
    <input name="unionid_old" type="hidden" value="<?php echo $unionid; ?>" />
    <input name="loginkey_old" type="hidden" value="<?php echo $loginkey; ?>" />
    <input name="t" type="hidden" value="<?php echo $t; ?>" />
    <input name="ifmini" type="hidden" value="<?php echo $ifmini; ?>" />
    <input name="iframenav" type="hidden" value="<?php echo $iframenav; ?>" />
    
    <!------------------------ 个人资料 -------------------->

    <?php }elseif ($t == 2){
		//基本资料
		$form_data=udata_arr('basic_form_adm');?>
		<style>
		.photo_stbl{border:0;border-collapse:collapse;background-color:#fff;border:0}
		.photo_stbl td{border:0;padding:0}
		.photo_stbl td .mmm2{width:100px}
		.photo_stbl td .BAI{line-height:28px;border-radius:20px;padding:0 15px;font-size:14px;margin-bottom:15px;color:#666}
		.photo_stbl td .BAI:last-child{margin-bottom:0}
        </style>
		<tr><td class="tdL">绑定微信</td><td colspan="3" class="tdR">

			<?php if (!empty($openid)){?>
                <button type="button" onClick="zeaiBindWeixin(<?php echo $uid;?>,'openid_cancel');" class="btn size2 HUI">解除绑定</button>
                <?php echo '　<font class="S12">OPENID：'.$openid.'</font>';if($subscribe==2)echo'<font class="C00f S12">（已取消关注）</font>';
            }else{ ?>
                <button type="button" onClick="zeaiBindWeixin(<?php echo $uid;?>,'openid_bind');" class="btn size2"><i class="ico">&#xe607;</i> 立即绑定</button>
                <span class="tips">绑定后，在微信可以直接登录进入无需注册</span>
                <div id="subscribe_box_my_set" class="my-subscribe_box">
                    <img id="Z_e___A___I__c___N" src="<?php echo HOST;?>/sub/creat_ewm.php?url=<?php echo HOST."/m/u_openid_bind.php?submitok=ewm&uid=".$uid;?>&u=<?php echo $session_uid;?>&p=<?php echo md5($session_pwd.'ZEAI.cn');?>">
                    <h3><i class="ico picmiddle S18" style="color:#45C01A">&#xe607;</i> <span class="picmiddle S14">请使用客户手机打开微信扫码</span><br>绑定成功后可以用微信登录进入当前用户帐号</h3>
                </div>
            <?php }?>
			<script>
            function zeaiBindWeixin(uid,type){
                if(type=='openid_bind'){
					zeai.div({obj:o('subscribe_box_my_set'),title:'绑定微信',w:400,h:450});
					setInterval(function(){chk_openid_bind(uid);},2000);
                }else if(type=='openid_cancel'){
                    zeai.confirm('确定解除绑定么？',function(){
                        zeai.ajax({url:'u_mod_data'+zeai.ajxext+'submitok=ajax_openid_bind_cancel&uid='+uid},function(e){var rs=zeai.jsoneval(e);
                            zeai.msg(rs.msg);
                            if(rs.flag==1){setTimeout(function(){location.reload(true);},1000);}
                        });
                    });
                }
                function chk_openid_bind(uid){
                    zeai.ajax({url:'u_mod_data'+zeai.ajxext+'submitok=ajax_openid_bind&uid='+uid},function(e){var rs=zeai.jsoneval(e);
                        if(rs.flag==1){
							zeai.msg(rs.msg);setTimeout(function(){location.reload(true);},1500);
						}
                    });
                }
            }
            </script>     


        </td></tr>
        <?php
		foreach($form_data as $V){
			$F = $V['fieldname'];
			$class = '';
			$DATA = $row_shalou[$F];$DATA_str = $DATA;
			switch ($V['subkind']) {
				case 1:
					$Fkind = 'text';
					$class=' class="input W300"';
					$DATA = trimhtml(dataIO($DATA,'out'),'keep_rn');
					$DATA_str = $DATA;
				break;
				case 2:
					$Fkind = 'radio';
					if($F=='job')$Fkind = 'select';
				break;
				case 3:$Fkind = 'checkbox';break;
				case 4:$Fkind = 'select';break;
			}
			//控件类型-特殊
			switch ($F) {
				case 'aboutus':$Fkind = 'textarea';$class=' rows="5" class="textarea W98_" placeholder="简短个人介绍，三观等" ';break;
				case 'birthday':
					$class=' maxlength="10" class="input W150" placeholder="格式为：1995-09-09" ';
					if(!ifdate($DATA))$DATA_str='';
				break;
				case 'nickname':$class=' maxlength="20" class="input W150" ';break;
			}
			//输出
			if($F=='photo_s'){
				if(!empty($DATA)){
					$photo_m_url = smb(UP.$DATA,'m');
					$photo_b_url = smb(UP.$DATA,'b');
				}else{
					$photo_m_url = RES.'photo_m'.$sex.'.png';
					$photo_b_url = $photo_m_url;
				}?>
				<tr><td class="tdL"><?php echo $V['title'];?></td><td colspan="3" class="tdR">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="photo_stbl">
                      <tr>
                        <td width="100"><img src="<?php echo $photo_m_url.'?'.ADDTIME;?>" class="mmm2 zoom" onClick="top.piczoom('<?php echo $photo_b_url; ?>');"></td>
                        <td width="130" align="right">
                        <input id="pic" type="file" style="display:none;" /> 
						<?php if(!empty($DATA)){?>
                        <a href="javascript:cut(<?php echo $uid; ?>,'<?php echo $title; ?>','<?php echo $p; ?>');" class="btn size2 BAI"><i class="ico">&#xe6a5;</i> 裁切头像</a>
                        <a class="btn size2 BAI" onclick="zeai.confirm('确定删除沙漏头像？',function(){zeai.post('u_mod_data'+zeai.extname,{iframenav:<?php echo intval($iframenav);?>,ifmini:<?php echo intval($ifmini);?>,submitok:'photo_s_shalou_del',uid:<?php echo $uid; ?>});});"><i class="ico">&#xe779;</i> 删除头像</a>
                        <?php }?>
                         <a href="javascript:up_m(<?php echo $uid; ?>,'<?php echo $title; ?>');" class="btn size2 BAI"><i class="ico">&#xe622;</i> 上传头像</a>
                        </td>
                        <td align="center">前台头像：<input type="checkbox" name="photo_ifshow" id="photo_ifshow" class="switch" value="1"<?php echo ($photo_ifshow == 1)?' checked':'';?>><label for="photo_ifshow" class="switch-label"><i></i><b>显示</b><b>隐藏</b></label></td>
                      </tr>
                      <tr>
                        <td colspan="3"><input type="checkbox" id="photo_sflag1" name="photo_sflag1" class="checkskin checkboxall" value="1" ><label for="photo_sflag1" class="checkskin-label"><i class="i1"></i><b class="W80 S14">覆盖原头像</b></label><div class="tips2 C8d" style="padding-top:5px">如果想保留原头像只审核资料，这里可以不打勾，否则新头像将覆盖原头像</div></td>
                      </tr>
                    </table>
                  </td></tr>
				<?php
			}elseif($F=='areaid'){
				$areaid = explode(',',$row_shalou['areaid']);
				$a1 = $areaid[0];$a2 = $areaid[1];$a3 = $areaid[2];$a4 = $areaid[3];
				$areatitle  = dataIO($row_shalou['areatitle'],'out');?>
                <tr>
                  <td class="tdL"><?php echo $V['title'];?></td>
                  <td colspan="3" class="tdR"><script>LevelMenu4('a1|a2|a3|a4|--|<?php echo $a1; ?>|<?php echo $a2; ?>|<?php echo $a3; ?>|<?php echo $a4; ?>|areaid|areatitle|<?php echo $areatitle;?>',' class="SW SW_area"');</script></td>
                </tr>
				<?php
			}elseif($F=='area2id'){
				$area2id = explode(',',$row_shalou['area2id']);
				$a11 = $area2id[0];$a22 = $area2id[1];$a33 = $area2id[2];$a44 = $area2id[3];
				$area2title  = dataIO($row_shalou['area2title'],'out');?>
                <tr>
                  <td class="tdL"><?php echo $V['title'];?></td>
                  <td colspan="3" class="tdR"><script>LevelMenu4('a11|a22|a33|a44|--|<?php echo $a11; ?>|<?php echo $a22; ?>|<?php echo $a33; ?>|<?php echo $a44; ?>|area2id|area2title|<?php echo $area2title;?>',' class="SW SW_area"','hj');</script></td>
                </tr>
				<?php
			}elseif($F=='truename' || $F=='identitynum'){
				$maxl=($F=='truename')?12:18;
				if(in_array('u_mod',$QXARR) || empty($DATA_str)){
				  $disti = '<input name="'.$F.'" type="text" class="W300" value="'.$DATA_str.'" maxlength="'.$maxl.'">';
				}else{
				  $disti =  '<input name="'.$F.'" type="hidden" value="'.$DATA_str.'" maxlength="'.$maxl.'">'.$DATA_str;
				}
                echo '<tr><td class="tdL">'.$V['title'].'</td><td colspan="3" class="tdR">'.$disti.'</td></tr>';
			}else{?>
				<tr><td class="tdL"><?php echo $V['title'];?></td><td colspan="3" class="tdR"><script>zeai_cn__CreateFormItem('<?php echo $Fkind;?>','<?php echo $F;?>','<?php echo $DATA_str;?>','<?php echo $class;?>');</script></td></tr>
				<?php
			}		
		}?>
		<td colspan="4" class="tbodyT"><center>详细资料</center></td>
		<?php
		//详细资料
		if (@count($extifshow) >= 1 && is_array($extifshow)){
			foreach ($extifshow as $V) {
				$fcls = '';$F = $V['f'];
				$DATA = $row_shalou[$F];$DATA_str = $DATA;
				switch ($V['s']) {
					case 1:
						$Fkind = 'text';$fcls=' class="input W300"';
						$DATA = trimhtml(dataIO($DATA,'wx'),'keep_rn');
						$DATA_str = $DATA;
					break;
					case 2:$Fkind = 'select';break;
					case 3:$Fkind = 'checkbox';break;
					case 4:$Fkind = 'range';break;
				}
				if($row_shalou['sex']==2 && $F=='tag1')continue;
				if($row_shalou['sex']==1 && $F=='tag2')continue;
				if($F=='tag1' || $F=='tag2')$DATA_str=$row_shalou['tag'];
				?>
                <tr><td class="tdL"><?php echo $V['t'];?></td><td colspan="3" class="tdR"><script>zeai_cn__CreateFormItem('<?php echo $Fkind;?>','<?php echo $F;?>','<?php echo $DATA_str; ?>','<?php echo $fcls;?>');</script></td></tr>
				<?php
			}
		}
		?>
        <td colspan="4" class="tbodyT"><center>红娘评价（印象）</center></td>
		<tr>
        <td class="tdL">评价内容</td>
        <td colspan="3" class="tdR"><textarea name="hnbbs" id="hnbbs" rows="5" class="textarea W98_" placeholder="对此用户的印象，综合评价；开启显示后，前台个人主页可以显示；最多1000字"><?php echo $hnbbs; ?></textarea></td>
        </tr>

        <input name="submitok" type="hidden" value="modupdate" />
        <input name="uid" type="hidden" value="<?php echo $uid; ?>" />
        <input name="t" type="hidden" value="<?php echo $t; ?>" />
        <input name="ifmini" type="hidden" value="<?php echo $ifmini; ?>" />
        <input name="iframenav" type="hidden" value="<?php echo $iframenav; ?>" />

    <!-- 择偶要求 -->
	<?php }elseif ($t == 4){?>
		<script>
		function chkform(){
			<?php if (in_array('age',$mate_diy)){?>
			if (mate_age1.value > mate_age2.value && (!zeai.empty(mate_age1.value) && !zeai.empty(mate_age2.value)) ){
				zeai.msg('年龄请选择一个正确的区间（左小右大）',mate_age1);	
				return false;
			}
			<?php }?>
			<?php if (in_array('heigh',$mate_diy)){?>
			if (mate_heigh1.value > mate_heigh2.value && (!zeai.empty(mate_heigh1.value) && !zeai.empty(mate_heigh2.value)) ){
				zeai.msg('身高请选择一个正确的区间（左小右大）',mate_heigh1);	
				return false;
			}
			<?php }?>
			<?php if (in_array('weigh',$mate_diy)){?>
			if (mate_weigh1.value > mate_weigh2.value && (!zeai.empty(mate_weigh1.value) && !zeai.empty(mate_weigh2.value)) ){
				zeai.msg('体重请选择一个正确的区间（左小右大）',mate_weigh1);	
				return false;
			}
			<?php }?>
		}</script>
        <?php
        if (count($mate_diy) >= 1 && is_array($mate_diy)){
            foreach ($mate_diy as $k=>$V) {
                $cook_tmp1 = 'mate_'.$V;
                $cook_mate_data = $row_shalou[$cook_tmp1];
                $ext = mate_diy_par($V,'ext');
				?>
				<tr><td class="tdL"><?php echo mate_diy_par($V);?></td><td colspan="3" class="tdR S16">
				<?php 
                switch ($ext) {
                    case 'radio':?><script>zeai_cn__CreateFormItem('select','<?php echo $cook_tmp1;?>','<?php echo $cook_mate_data; ?>','',<?php echo $cook_tmp1.'_ARR';?>);</script><?php ;break;
                    case 'checkbox':?><script>zeai_cn__CreateFormItem('checkbox','<?php echo $cook_tmp1;?>','<?php echo $cook_mate_data; ?>','',<?php echo $cook_tmp1.'_ARR';?>);</script><?php break;
                    case 'radiorange':
						$cook_tmp1_1 = 'mate_'.$V.'1';
						$cook_mate_data_1 = $row_shalou[$cook_tmp1_1];
						$cook_tmp1_2 = 'mate_'.$V.'2';
						$cook_mate_data_2 = $row_shalou[$cook_tmp1_2];
						?>
						<script>zeai_cn__CreateFormItem('select','<?php echo $cook_tmp1_1;?>','<?php echo $cook_mate_data_1; ?>','',<?php echo $cook_tmp1.'_ARR';?>);</script>
                         ～ 
						<script>zeai_cn__CreateFormItem('select','<?php echo $cook_tmp1_2;?>','<?php echo $cook_mate_data_2; ?>','',<?php echo $cook_tmp1.'_ARR';?>);</script>
						<?php break;
                    case 'area':
						if($V=='areaid2'){
							$mate_areaid2     = $row_shalou['mate_areaid2'];
							$mate_areatitle2  = $row_shalou['mate_areatitle2'];
							$mate_areaid2   = explode(',',$mate_areaid2);
							$h1 = $mate_areaid2[0];$h2 = $mate_areaid2[1];$h3 = $mate_areaid2[2];$h4 = $mate_areaid2[3];

							$idlist='h1|h2|h3|h4';	
							$deflist= $h1.'|'.$h2.'|'.$h3.'|'.$h4;
							$iputhienT = 'mate_areatitle2';
							$hj='hj';
						}else{
							$mate_areaid    = $row_shalou['mate_areaid'];
							$mate_areatitle = $row_shalou['mate_areatitle'];
							$mate_areaid    = explode(',',$mate_areaid);
							$m1 = $mate_areaid[0];$m2 = $mate_areaid[1];$m3 = $mate_areaid[2];$m4 = $mate_areaid[3];

							$idlist='m1|m2|m3|m4';
							$deflist= $m1.'|'.$m2.'|'.$m3.'|'.$m4;
							$iputhienT = 'mate_areatitle';
							$hj='';
						}
						?><script>LevelMenu4('<?php echo $idlist;?>|'+nulltext+'|<?php echo $deflist;?>|<?php echo $cook_tmp1;?>|<?php echo $iputhienT;?>|<?php echo $$iputhienT;?>','','<?php echo $hj;?>');</script><?php break;
                }
				?>
				</td></tr>
        <?php }}?>
				<tr><td class="tdL">其他要求</td><td colspan="3" class="tdR S16"><textarea name="mate_other" rows="5" class="W98_" id="aboutus" placeholder="填写其他要求(500字节以内)"><?php echo $mate_other; ?></textarea></td></tr>
        
        
    <!--联系方法-->
    <?php }elseif ($t == 3){
			if(!crm_ifcontact($agentid,$admid,$hnid,$hnid2) && $session_kind == 'crm'){
				exit(noauth('暂无联系方法查看权限'));
			}
			$address    = dataIO($row_shalou['address'],'out');
			$weixin     = dataIO($row_shalou['weixin'],'out');
			$qq         = dataIO($row_shalou['qq'],'out');
			$email      = dataIO($row_shalou['email'],'out');
			$weixin_pic = $row_shalou['weixin_pic'];
		?>
		<script>//QQ:7144100</script>
            <tr>
              <td class="tdL">手　　机</td>
              <td colspan="3" class="tdR">
				  <?php if(in_array('u_mod',$QXARR) || !ifmob($data_mob)){?>
                  <input name="mob" type="text" class="W300" id="mob" value="<?php echo $data_mob; ?>" maxlength="11">
                  <?php }else{ ?>
                  <input name="mob" type="hidden" value="<?php echo $data_mob; ?>" maxlength="11">
                  <?php echo $data_mob; ?>　
                  <?php }?>
                  <input type="checkbox" name="mob_ifshow" id="mob_ifshow" class="switch" value="1"<?php echo ($data_mob_ifshow == 1)?' checked':'';?>><label for="mob_ifshow" class="switch-label"><i></i><b>前台公开</b><b>保密</b></label>
              </td>
              </tr>
            <tr>
            <tr>
              <td class="tdL">备用手机</td>
              <td colspan="3" class="tdR">
				  <?php if(in_array('u_mod',$QXARR) || !ifmob($data_mob2)){?>
                  <input name="mob2" type="text" class="W300" id="mob2" value="<?php echo $data_mob2; ?>" maxlength="11">
                  <?php }else{ ?>
                  <input name="mob2" type="hidden" value="<?php echo $data_mob2; ?>" maxlength="11">
                  <?php echo $data_mob2; ?>　
                  <?php }?>
              </td>
              </tr>
            <tr>
              <td class="tdL">微 信 号</td>
              <td colspan="3" class="tdR">
                <input name="weixin" type="text" class="W300" id="weixin" value="<?php echo $weixin; ?>">
                <input type="checkbox" name="weixin_ifshow" id="weixin_ifshow" class="switch" value="1"<?php echo ($data_weixin_ifshow == 1)?' checked':'';?>><label for="weixin_ifshow" class="switch-label"><i></i><b>前台公开</b><b>保密</b></label>
              </td>
              </tr>
            <tr>
              <td class="tdL">微信二维码</td>
              <td colspan="3" class="tdR">
              
            <div class="picli60">
                <li class="add" id="add"<?php echo (!empty($weixin_pic))?' style="display:none"':' style="display:block"'?>></li>
                <li id="weixin_picshow"<?php echo (!empty($weixin_pic))?' style="display:block"':' style="display:none"'?>><img src="<?php echo (!empty($weixin_pic))?UP.$weixin_pic:'';?>"><i></i></li>
            </div>
            <input type="checkbox" name="weixin_pic_ifshow" id="weixin_pic_ifshow" class="switch" value="1"<?php echo ($data_weixin_pic_ifshow == 1)?' checked':'';?>><label for="weixin_pic_ifshow" class="switch-label" style="margin-top:17px;margin-left:243px"><i></i><b>前台公开</b><b>保密</b></label>
              </td>
              </tr>
            <tr>
              <td class="tdL">QQ</td>
              <td colspan="3" class="tdR">
              <input name="qq" type="text" class="W300" id="qq" value="<?php echo $qq; ?>">
                <input type="checkbox" name="qq_ifshow" id="qq_ifshow" class="switch" value="1"<?php echo ($data_qq_ifshow == 1)?' checked':'';?>><label for="qq_ifshow" class="switch-label"><i></i><b>前台公开</b><b>保密</b></label>
              </td>
              </tr>
            <tr>
              <td class="tdL">邮　　箱</td>
              <td colspan="3" class="tdR">
                <input name="email" type="text" class="W300" id="email" value="<?php echo $email; ?>">
                <input type="checkbox" name="email_ifshow" id="email_ifshow" class="switch" value="1"<?php echo ($data_email_ifshow== 1)?' checked':'';?>><label for="email_ifshow" class="switch-label"><i></i><b>前台公开</b><b>保密</b></label>
              </td>
              </tr>
            <tr>
            <td class="tdL">地　　址</td>
            <td colspan="3" class="tdR"><input name="address" type="text" class="W300" id="address" value="<?php echo $address; ?>" maxlength="50"></td>
            </tr>
            <tr>
            <td class="tdL">地图坐标</td>
            <td colspan="3" class="tdR">
        经度：<input name="longitude" type="text" id="longitude" value="<?php echo $longitude; ?>" maxlength="20" >　
        纬度：<input name="latitude" type="text" id="latitude" value="<?php echo $latitude; ?>" maxlength="20" >　
        <a href="javaacript:;" id="Zeai_map_btn" class="btn size2"><i class="ico">&#xe624;</i> 标注位置</a>
        <script>
			Zeai_map_btn.onclick=function(){
			var lng=longitude.value,lat=latitude.value;
			zeai.iframe('定位标注','map_set.php?var1=longitude&var2=latitude&longitude='+lng+'&latitude='+lat+'&areatitle=<?php echo $areatitle; ?>',630,550);}
		</script>
            
            </td>
            </tr>
            <input name="submitok" type="hidden" value="modupdate" />
            <input name="uid" type="hidden" value="<?php echo $uid; ?>" />
            <input name="mob_old" type="hidden" value="<?php echo $data_mob; ?>" />
            <input name="mob2_old" type="hidden" value="<?php echo $data_mob2; ?>" />
            <input name="email_old" type="hidden" value="<?php echo $email; ?>" />
            <input name="t" type="hidden" value="<?php echo $t; ?>" />
            <input name="ifmini" type="hidden" value="<?php echo $ifmini; ?>" />
            <input name="iframenav" type="hidden" value="<?php echo $iframenav; ?>" />
            <script>
                weixin_picshow.children[0].onclick = function(){parent.piczoom('<?php echo UP.$weixin_pic;?>');}
                weixin_picshow.children[1].onclick = function(){
                    zeai.confirm('亲~~确认删除么？',function(){
                        weixin_picshow.hide();add.show();weixin_picshow.children[0].src = '';
                        zeai.ajax('u_mod_data'+zeai.ajxext+'submitok=ajax_weixin_pic_del&uid='+uid);
                    });
                }
                if (!zeai.empty(o('add')))add.onclick=function(){
                    zeai.up({"url":"u_mod_data"+zeai.extname,"upMaxMB":upMaxMB,"submitok":"ajax_weixin_pic_up","uid":uid,"fn":function(e){var rs=zeai.jsoneval(e);	
                        if (rs.flag == 1){
                            zeai.msg('上传成功！');
                            var img = weixin_picshow.children[0];img.src=rs.tmpphoto;
                            img.onclick = function(){parent.piczoom(rs.tmpphoto);}
                            weixin_picshow.show();add.hide();
                        }else{zeai.alert('上传出错，请联系扬州交友网开发者客服QQ7144100');}
                    }});
                }
                zeai.listEach('.switch',function(obj){
                    var objname = obj.name;
                    obj.onclick = function(){
                        var v=(obj.checked)?1:0
                        zeai.ajax({url:'u_mod_data'+zeai.ajxext+'submitok=ajax_set&objname='+objname+'&v='+v+'&uid=<?php echo $uid; ?>'},function(e){var rs=zeai.jsoneval(e);
                            zeai.msg(0);zeai.msg(rs.msg);
                        });
                    }
                });
                
            </script>
    
    
    
    
        
    <!--认证资料-->
    <?php
	}elseif ($t == 6){
		if (count($rz_dataARR) >= 1 && is_array($rz_dataARR)){foreach ($rz_dataARR as $k=>$V) {?>
		<tr><td class="tdL"><?php echo rz_data_info($V,'title');?></td><td colspan="3" class="tdR ">
        <div class="rzboxx">
            <?php $rzdata = RZ_get_tableinfo($uid,$V);if(is_array($rzdata)){$p1 = $rzdata['p1'];$p2 = $rzdata['p2'];$bz = dataIO($rzdata['bz'],'out');}else{$p1 = '';$p2 = '';$bz = '';}?>
            <li>
				<?php if (!empty($p1)) {?>
                    <a class="pic60"><img  src="<?php echo UP.$p1; ?>" class="zoom" align="absmiddle" alt="点击放大显示" title="点击放大显示" onClick="parent.piczoom('<?php echo UP.smb($p1,'b'); ?>')"></a>
                    <?php if (@in_array('crm',$QXARR) || $session_kind == 'adm'){?><br><a href="javascript:;" onClick="rzpicDel('<?php echo $V;?>_1')" class="btn size1" >删除</a><?php }?>
                <?php }else{ 
                    echo "<input name='pic_".$V."1' type='file' class='input size2' accept='image/gif,image/jpeg,image/png' />";
                }?>        
            </li>
            <li>
				<?php if (!empty($p2)) {?>
                    <a class="pic60"><img  src="<?php echo UP.$p2; ?>" class="zoom " align="absmiddle"  title="点击放大显示" alt="点击放大显示" onClick="parent.piczoom('<?php echo UP.smb($p2,'b'); ?>')"></a>
                    <?php if (@in_array('crm',$QXARR) || $session_kind == 'adm'){?><br><a href="javascript:;" onClick="rzpicDel('<?php echo $V;?>_2')" class="btn size1" >删除</a><?php }?>
                <?php }else{ 
                    echo "<input name='pic_".$V."2' type='file' class='input size2'accept='image/gif,image/jpeg,image/png' />";
                }?>        
            </li>
            <li style="width:300px"><textarea name="bz_<?php echo $V; ?>" rows="3" class="W98_" placeholder="备注信息(500字节以内)"><?php echo $bz; ?></textarea><input name="oldbz_<?php echo $V; ?>" type="hidden" value="<?php echo $bz; ?>" /></li>
		</div>
        </td></tr>
	<?php }}}?>
    </table>
    <script>
	function rzpicDel(picid){
		zeai.confirm('确认要删除么？',function(){
			zeai.ajax({url:'u_mod_data'+zeai.extname,data:{submitok:'rzpicDel',picid:picid,uid:<?php echo $uid;?>,t:<?php echo $t;?>}},function(e){var rs=zeai.jsoneval(e);
				if (rs.flag == 1){zeai.msg(rs.msg);setTimeout(function(){location.reload(true);},1000);}else{zeai.alert(rs.msg);}
			});
		});
	}
	var ifage=false,ifheigh=false,ifweigh=false;
	<?php if (in_array('age',$mate_diy)){?>ifage=true;<?php }?>
	<?php if (in_array('heigh',$mate_diy)){?>ifheigh=true;<?php }?>
	<?php if (in_array('weigh',$mate_diy)){?>ifweigh=true;<?php }?>

	<?php if ($t!=5){?>
	function chkform(){
		<?php if ($t == 6){?>
		zeai.confirm('<b class="S18">确定提交么？</b><br>此操作只是记录和内部存档（用户认证审核列表将显示），不点亮认证图标<br>如需点亮请点击：<a href="cert_hand.php?submitok=mod&memberid=<?php echo $uid;?>" class="blue B">手动强制认证</a><br>　',function(){o(supdesQQ797311_form).submit();});
		<?php }elseif($t == 3){?>
			//zeai.confirm('<b class="S18">确定提交么？</b><br>此操作将直接修改（自动通过审核）直接显示<br>　',function(){o(supdesQQ797311_form).submit();});
			o(supdesQQ797311_form).submit();
		<?php }elseif($t == 4){?>
			if(t==4){
				if(ifage){
				if (mate_age1.value > mate_age2.value && (!zeai.empty(mate_age1.value) && !zeai.empty(mate_age2.value)) ){
					zeai.msg('年龄请选择一个正确的区间（左小右大）',mate_age1);	
					return false;
				}}
				if(ifheigh){
				if (mate_heigh1.value > mate_heigh2.value && (!zeai.empty(mate_heigh1.value) && !zeai.empty(mate_heigh2.value)) ){
					zeai.msg('身高请选择一个正确的区间（左小右大）',mate_heigh1);	
					return false;
				}}
				
			}
			//zeai.confirm('<b class="S18">确定提交么？</b><br>此操作将直接修改（自动通过审核）直接显示<br>　',function(){o(supdesQQ797311_form).submit();});
			o(supdesQQ797311_form).submit();
		<?php }elseif($t == 1){?>
			//zeai.confirm('<b class="S18">确定提交么？</b><br>　',function(){o(supdesQQ797311_form).submit();});
			o(supdesQQ797311_form).submit();
		<?php }elseif($t == 2){?>
			//zeai.confirm('<b class="S18">确定提交么？</b><br>此操作将直接修改（自动通过审核），前端用户资料和头像（<font class="Cf00">选中【覆盖原头像】</font>后）直接显示<br>　',function(){o(supdesQQ797311_form).submit();});
			o(supdesQQ797311_form).submit();
		<?php }?>
		return false;
	}
    <?php }?>
    </script>
    <input name="submitok" type="hidden" value="modupdate" />
    <input name="uid" type="hidden" value="<?php echo $uid; ?>" />
    <input name="t" type="hidden" value="<?php echo $t; ?>" />
    <input name="ifmini" type="hidden" value="<?php echo $ifmini; ?>" />
    <input name="iframenav" type="hidden" value="<?php echo $iframenav; ?>" />
<!--基本资料，详细资料，择偶要求 结束-->
<?php }?>
<!--  -->
</td>
</tr>
</table>
<?php if ($submitok != 'photo'){?>
<br><br><br><br>
<style>
@-moz-document url-prefix() {.savebtnbox{bottom:50px}}
</style>
<div class="savebtnbox"><button type="submit" class="btn size3">确定并保存</button></div>
<?php }?>
</form>
<?php }?>
<?php if($t == 222222222){?><script src="laydate/laydate.js"></script><script>lay('#version').html('-v'+ laydate.v);laydate.render({elem: '#birthday'});</script><?php }?>
<?php
function RZ_get_tableinfo($uid,$rzid) {
	global $db;
	$row = $db->ROW(__TBL_RZ__,"path_b,path_b2,bz","uid=".$uid." AND rzid='$rzid'");
	if ($row){
		return array('p1'=>$row[0],'p2'=>$row[1],'bz'=>$row[2]);
	}else{
		return '';
	}
}
require_once 'bottomadm.php';?>